import request from '@/utils/request'

export default {
  /**
   * 工作日志列表 true
   * @param {Object} data
   */
  async getList(data) {
    return await request({
      url: '/index/Log/log_list',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 日志模板 true
   * @param {Object} data
   */
  async getTemplete(data) {
    return await request({
      url: '/index/Log/getTemplete',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 工作日志详情 true
   * @param {Object} data
   */
  async getLogDetails(data) {
    return await request({
      url: '/index/Log/get_log_byid',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 新增日志 true
   * @param {Object} data
   */
  async addLog(data) {
    return await request({
      url: '/index/Log/add_log',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 编辑日志 true
   * @param {Object} data
   */
  async editLog(data) {
    return await request({
      url: '/index/Log/edit_log',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 评论列表 true
   * @param {Object} data
   */
  async getComment(data) {
    return await request({
      url: '/index/Log/comment_list',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 保存评论 true
   * @param {Object} data
   */
  async saveComment(data) {
    return await request({
      url: '/index/Log/save_comment',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 删除评论 true
   * @param {Object} data
   */
  async delComment(data) {
    return await request({
      url: '/index/Log/del_comment',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 点赞 true
   * @param {Object} data
   */
  async doThumb(data) {
    return await request({
      url: '/index/Log/do_thumb',
      data: data,
      method: 'POST',
    })
  },

  /**
   * 已读 true
   * @param {Object} data
   */
  async doRead(data) {
    return await request({
      url: '/index/Log/do_read',
      data: data,
      method: 'POST',
    })
  },
}

// 查询日志详情
export function logDetails(data) {
  return request({
    url: `/index/Log/log_list_id`,
    method: 'POST',
    data,
  })
}

export function getLogReport(data) {
  return request({
    url: `/index/LogSetting/detail`,
    method: 'POST',
    data,
  })
}
